package Acm题.java部分.二维数组;



/**
 * @ClassName Acm1458
 * @Description
 * 输入一个2*3和3*2的二维数组，求两个矩阵之积。
 * 输入
 * 1 2 0
 * 3 4 2
 * 1 3
 * 2 4
 * 3 1
 * 输出
 * 5 11
 * 17 27
 * @Author 李明忠
 * @Date 2024/10/18 15:55
 * @Version 1.0
 */
import java.util.Scanner;
public class Acm1458 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[][] arr1=new int[2][3];
        int[][] arr2=new int[3][2];
        int[][] arr=new int[2][2];
        for (int i = 0; i < arr1.length; i++) {
            for (int j = 0; j < arr1[i].length; j++) {
                arr1[i][j]=sc.nextInt();
            }
        }
        for (int i = 0; i < arr2.length; i++) {
            for (int j = 0; j < arr2[i].length; j++) {
                arr2[i][j]=sc.nextInt();
            }
        }
        for (int i = 0; i < 2; i++) {
            for (int k = 0; k < 3; k++) {
                for (int j = 0; j < 2; j++) {
                    //[0][0]=[0][k]*[k][0]
                    //[0][1]=[0][k]*[k][1]
                    arr[i][j]+=(arr1[i][k]*arr2[k][j]);
                }
            }
        }
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                System.out.print(arr[i][j]+" ");
            }
            System.out.println();
        }
    }
}
